package com.zhuoyue.system.service.impl;

import com.zhuoyue.common.annotation.DataScope;
import com.zhuoyue.system.domain.TblUserApiReqCount;
import com.zhuoyue.system.domain.TblAppUserLoginLog;
import com.zhuoyue.system.domain.po.SelectTimePo;
import com.zhuoyue.system.mapper.TblLogManageMapper;
import com.zhuoyue.system.mapper.TblUserReqCountMapper;
import com.zhuoyue.system.service.ITblLogManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author hewenze
 * @date 2021-08-18
 */
@Service
public class TblUserLogManageServiceImpl implements ITblLogManageService {
    @Autowired
    private TblLogManageMapper logManageMapper;

    @Autowired
    private TblUserReqCountMapper userReqCountMapper;

    @Autowired
    private ITblLogManageService logManageService;

    /**
     * 查询用户登录日志列表
     *
     * @param tblUserLoginMessage 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    @DataScope(deptAlias = "s_d")
    public List<TblAppUserLoginLog> selectTblUserLoginMessageList(TblAppUserLoginLog tblUserLoginMessage) {
        return logManageMapper.selectAppUserLoginLogList(tblUserLoginMessage);
    }

    @Override
    @DataScope(deptAlias = "s_d")
    public List<TblUserApiReqCount> selectTblUserReqCountList(TblUserApiReqCount tblUserReqCount) {
        return userReqCountMapper.selectTblUserReqCountList(tblUserReqCount);
    }

    @Override
    @DataScope(deptAlias = "s_d")
    public int getUserLoginLogCountByOrgCode(SelectTimePo selectTimePo) {
        return logManageService.getUserLoginLogCountByOrgCode(selectTimePo);
    }

    @Override
    @DataScope(deptAlias = "s_d")
    public int getUserApiReqCountByOrgCode(SelectTimePo selectTimePo) {
        return logManageService.getUserApiReqCountByOrgCode(selectTimePo);
    }

}
